

using System;
using System.Collections.Generic;
using System.Text;
using EntityLayer;
using System.Data;
using DataAccessLayer;

namespace DataLayer
{
	public class datArticleComments
	{
		public datArticleComments()
		{
		}
		
		#region  Code Factory Generated Methods
		public void DeleteArticleCommentsByArticleCommentId(entArticleComments parEntArticleComments, DbConnector parDbConnector)
		{
			DbParamCollection insDbParamCollection = new DbParamCollection();
			insDbParamCollection.Add("@pArticleCommentId",parEntArticleComments.ArticleCommentId);
			parDbConnector.ExecuteNonQuery("DeleteArticleCommentsByArticleCommentId",insDbParamCollection);
		}
		public void InsertArticleComments(entArticleComments parEntArticleComments, DbConnector parDbConnector)
		{
			DbParamCollection insDbParamCollection = new DbParamCollection();
			insDbParamCollection.Add("@pArticleContentId",parEntArticleComments.ArticleContentId);
			insDbParamCollection.Add("@pArticleCommentUserName",parEntArticleComments.ArticleCommentUserName);
			insDbParamCollection.Add("@pArticleCommentUserWebSite",parEntArticleComments.ArticleCommentUserWebSite);
			insDbParamCollection.Add("@pArticleCommentUserEmail",parEntArticleComments.ArticleCommentUserEmail);
			insDbParamCollection.Add("@pArticleCommentUserIpAddress",parEntArticleComments.ArticleCommentUserIpAddress);
			insDbParamCollection.Add("@pArticleCommentDate",parEntArticleComments.ArticleCommentDate);
			insDbParamCollection.Add("@pArticleCommentBody",parEntArticleComments.ArticleCommentBody);
			insDbParamCollection.AddOutput("@pArticleCommentId",DbType.Int32);
			parDbConnector.ExecuteNonQuery("InsertArticleComments",insDbParamCollection);
			parEntArticleComments.ArticleCommentId = Convert.ToInt32(insDbParamCollection.GetOutPutParameter().Value);
		}
       
		#endregion
        public void DeleteArticleCommentsByArticleContentId(entArticleComments parEntArticleComments, DbConnector parDbConnector)
        {
            DbParamCollection insDbParamCollection = new DbParamCollection();
            insDbParamCollection.Add("@pArticleContentId", parEntArticleComments.ArticleContentId);
            parDbConnector.ExecuteNonQuery("DeleteArticleCommentsByArticleContentId", insDbParamCollection);
        }
        public DataTable SelectArticleCommentsByArticleContentId(entArticleComments parEntArticleComments, DbConnector parDbConnector)
        {
            DbParamCollection insDbParamCollection = new DbParamCollection();
            insDbParamCollection.Add("@pArticleContentId", parEntArticleComments.ArticleContentId);
            return parDbConnector.ExecuteDataTable("SelectArticleCommentsByArticleContentId", insDbParamCollection);
        }
	}
}